/**
 * Created by WT-SUN on 2017/4/19.
 */

$(function () {
    if (arrForbid.length>0){
        occforbidTb();
    }else {
        $("#occforbidTbDiv").hide();
    }
    if(arrDoubt.length>0){
        occdoubtTb();
    }else {
        $("#occdoubtTbDiv").hide();
    }
    if(arrOther.length>0){
        occotherTb();
    }else {
        $("#occotherTbDiv").hide();
    }
    $("#danwei").textbox('setValue', danweiName).textbox('setText', danweiName);
    $("#zyweihai").textbox('setValue', phyHarmIdsName).textbox('setText', phyHarmIdsName);
});
/**
 * 职业禁忌
 */
function occforbidTb() {
    $('#occforbidTb').datagrid({
        fitColumns: true,
        //pagination: true,
        idField: 'id',
        data:arrForbid,
        rownumbers: true,
        sortOrder: true,
        singleSelect: true,
        striped: true,
        fit: false,
        height: 300,
        columns: [[
            {
             field: 'id',
             checkbox: true
             },
            {field: 'forbidName', title: '职业禁忌证名称', width: 100},
            {field: 'forbidWork', title: '禁忌作业', width: 100},
            {field: 'remarks', title: '备注', width: 100}
        ]],
    });
}
/**
 * 疑似职业病
 */
function occdoubtTb() {
    $('#occdoubtTb').datagrid({
        fitColumns: true,
        data:arrDoubt,
        //pagination: true,
        idField: 'id',
        rownumbers: true,
        sortOrder: true,
        singleSelect: true,
        striped: true,
        fit: false,
        height: 300,
        columns: [[
            {
                field: 'id',
                checkbox: true
            },
            {field: 'diseasesName', title: '职业病名称', width: 100},
            {field: 'diseasesCode', title: '编码', width: 100},
            {field: 'remarks', title: '备注', width: 100}
        ]]
    });
}
/**
 * 其它疾病或异常
 */
function occotherTb() {
    $('#occotherTb').datagrid({
        fitColumns: true,
        idField: 'id',
        data:arrOther,
        rownumbers: true,
        sortOrder: true,
        singleSelect: true,
        striped: true,
        fit: false,
        height: 300,
        columns: [[
            {
                field: 'id',
                checkbox: true
            },
            {field: 'diseasesName', title: '疾病名称', width: 100},
            {field: 'remarks', title: '备注', width: 100}
        ]]
    });
}


